package com.atguigu.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@TableName(value = "t_user")
@Data
@Accessors(chain = true)
public class User {
//    @TableId(type = IdType.ASSIGN_ID)

    @TableId(value = "uid",type = IdType.AUTO)
    private Long id;

    @TableField(value = "username")
    private String name;
    private int age;
    private String email;


    @TableField(fill = FieldFill.INSERT)        //在插入的时候维护
    private LocalDateTime createTime;   //创建时间
    @TableField(fill = FieldFill.INSERT_UPDATE) //在插入或者修改的时候同时维护
    private LocalDateTime updateTime;   //更新时间


    @TableField(value = "is_deleted")
    @TableLogic     //逻辑删除
    private boolean deleted;


}
